package nl.saxion.security.gui;

import java.awt.Font;

import javax.swing.JPanel;

import nl.saxion.security.config.Config;
import nl.saxion.security.gui.elements.AbstractPassPanel;
import nl.saxion.security.gui.elements.AbstractSyncListPanel;
import nl.saxion.security.gui.elements.AbstractPathPanel;
import nl.saxion.security.gui.elements.PassPanel;
import nl.saxion.security.gui.elements.SyncListPanel;
import nl.saxion.security.gui.elements.PathPanel;


import com.google.inject.AbstractModule;
import com.google.inject.name.Names;

public class GUIModule extends AbstractModule {
	
	private Config config;
	
	private Font defaultFont;
	
	public GUIModule()
	{
		super();

	}
	
	@Override
	protected void configure() {
		bind(Config.class)
		.annotatedWith(Names.named("DefaultConfig"))
		.toInstance(config);
		
		bind(Font.class)
		.annotatedWith(Names.named("DefaultFont"))
		.toInstance(defaultFont);
		
		bind(JPanel.class).to(MainPanel.class);		

		bind(AbstractSyncListPanel.class).to(SyncListPanel.class);
		bind(AbstractPathPanel.class).to(PathPanel.class);
		bind(AbstractPassPanel.class).to(PassPanel.class);
	}
	
	public void setConfig(Config c)
	{
		config = c;
	}

	public void setDefaultFont(Font f)
	{
		defaultFont = f;
	}
	
}
